package com.sc.dao;

import java.util.List;

import org.beetl.sql.core.annotatoin.Sql;
import org.beetl.sql.core.mapper.BaseMapper;

import com.sc.model.Order;

public interface OrderDao extends BaseMapper<Order> {

	@Sql(value = "select * from `order` o where o.user_id = ? and o.is_delete = 0 limit ? , ?")
	List<Order> getByUserId(String userId, int page, int rows);

	@Sql(value = "select count(*) from `order` o where o.user_id = ? and o.is_delete = 0")
	long getByUserIdCount(String userId);

	@Sql(value = "update `order` o set o.is_delete = 1 where o.id = ?")
	int deleteById(String id);

}
